package com.suixun.util.enums;

import com.suixun.util.Valuable;

import java.util.Iterator;

/**
 *
 */
public enum DatestampUnit implements Valuable<Integer>, Iterator<DatestampUnit> {

	ERA(0), YEAR(1), MONTH(2), DATE(5), HOUR(10), HOUR_OF_DAY(11), MINUTE(12), SECOND(
			13), MILLISECOND(14);

	private int field;

	DatestampUnit(int field) {
		this.field = field;
	}

	@Override
	public Integer value() {
		return field;
	}

	@Override
	public boolean hasNext() {
		return this.ordinal() != DatestampUnit.values().length - 1;
	}

	@Override
	public DatestampUnit next() {
		return DatestampUnit.values()[ordinal() + 1];
	}

	@Override
	public void remove() {
		throw new UnsupportedOperationException();
	}

}
